<template>
  <div :class='s.wrap' v-if='winner !== ""'>
    <i class='iconfont icon-laba'></i>
    比赛已结束，恭喜<span>{{winner}}</span>获得冠军
  </div>
</template>

<script>
import RemoteDAO from 'common/remoteDAO'

export default {
  props: {
    gameID: String
  },
  data () {
    return {
      winner: ''
    }
  },
  mounted () {
    this.fetchWinner()
  },
  methods: {
    fetchWinner () {
      RemoteDAO.callHB003('8224472', this.gameID, '1','1', '4', resp => {
        if (resp.error ==='0' && resp.data.body.length > 0){
          this.winner = resp.data.body[0].NICKNAME
        }
      })
    }
  }
}
</script>

<style lang="less" module='s'>
.wrap{
  background-color: #fff7c4;
  color: #bf3211;
  font-size: 12px;
  text-align: center;
  margin: 10px auto;
  span{
    color: #42b8ef;
  }
}
</style>